-- ignore_resist
-- created by xinj
-- 忽视抗性

return {
    apply = function(prop, baseValue)
        return math.max(0, baseValue - prop[3]);
    end,

    desc = function(prop)
        local row = PropM.getRow(prop[1]);
        local desc = row.desc;

        if ("attack" == prop[2] or "magic" == prop[2])
            and not isFullWidthLang() then
            desc = getLocStr("prop_ignore_resist");
        end

        -- 魔法抗性，物理抗性
        if "attack" == prop[2] then
            desc = string.gsub(desc, "{resist}", getLocStr("physical_resistance"));
        else
            desc = string.gsub(desc, "{resist}", getLocStr("spell_resistance"));
        end

        if "attack" == prop[2] then
            desc = string.gsub(desc, "{0}", getLocStr("all_magic"));
        elseif "magic" == prop[2] then
            desc = string.gsub(desc, "{0}", getLocStr("all_attack"));
        else
            desc = string.gsub(desc, "{0}", SkillM.query(tonumber(prop[2]), "name"));
        end

        local v = prop[3] / 10;
        desc = string.gsub(desc, "{1}", v);

        return desc;
    end,

    record = function(target, prop, path)
        return false;
    end
};